﻿using System.Windows.Forms;
using TeamDeployer.TeamFoundation.Build.Workflow.CustomTypes;

namespace TeamDeployer.TeamFoundation.Build.Workflow.Design
{
    public static class HelperExtensions
    {
        // Methods
        public static ListViewItem ToListViewItem(this DeploySpec item)
        {
            ListViewItem item2 = new ListViewItem(item.Name)
            {
                Tag = item.Id
            };
            item2.SubItems.Add(item.Enabled ? "Yes" : string.Empty);
            return item2;
        }
        public static ListViewItem ToListViewItem(this DatabaseSpec item)
        {
            ListViewItem item2 = new ListViewItem("[ "+item.TargetServer +" ].[ "+item.TargetDatabase+"]" )
            {
                Tag = item.Id
            };
            item2.SubItems.Add(item.Deploy ? "Yes" : string.Empty);
            return item2;
        }
    }
}